package nancal.mp


import nancal.mp.db.redis.rer
import nbcp.base.db.LoginUserModel
import nbcp.base.extend.ToJson
import nbcp.base.utils.SpringUtil
import nbcp.myoql.db.sql.component.RawQuerySqlClip
import org.junit.jupiter.api.Test
import org.springframework.web.bind.annotation.RestController

class NacosTest : TestBase() {
    @Test
    fun syncNacos() {
        var login = LoginUserModel()
        login.loginName = "udi"
        rer.iam.oauthToken("udi").set(login)

        for (i in 0..10) {
            var r = rer.iam.oauthToken("udi").get()

            Thread.sleep(1000)
        }
    }

    @Test
    fun test2() {
        var list = SpringUtil.context.getBeanNamesForAnnotation(RestController::class.java)
        println(list.map { it::class.java.name + ":" })
    }


    @Test
    fun abc() {
        RawQuerySqlClip("select * from user").toMapList()
            .forEach {
                println(it.ToJson())
            }
    }
}